import {URL} from "node:url"

// /D:/gitee/Tutorial/JavaScriptTutorial/node/lesson01/module_function/es6module.js
const __filename = new URL('',import.meta.url).pathname

// 去掉最后一个斜杠的尾部
// /D:/gitee/Tutorial/JavaScriptTutorial/node/lesson01/module_function/
const __dirname = new URL('.',import.meta.url).pathname


console.log(__dirname)
console.log(__filename)